package io.bhex.app.trade.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Pair;

import java.util.ArrayList;

/**
 * ================================================
 * 作   者：ppzhao
 * 创建时间：2019-09-22
 * 邮   箱：
 * 描   述：
 * ================================================
 */

public class ContractOrderTypeFragmentPagerAdapter extends FragmentPagerAdapter {

    private ArrayList<Pair<String, Fragment>> mFragments;

    public ContractOrderTypeFragmentPagerAdapter(FragmentManager fm, ArrayList<Pair<String, Fragment>> items) {
        super(fm);
        mFragments = items;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position).second;
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mFragments.get(position).first;
    }


}
